import React from 'react'
import NewsPublish from "../../../components/publish-manager/NewsPublish";
import usePublish from "../../../components/publish-manager/usePublish";
import {Button} from "antd";

export default function Sunset() {
    const{data,handleDelete}=usePublish(3)
    return (
        <div>
            {/*button属性传递一个函数，函数被NewsPublish的Table调用，
            返回一个Button组件，这个Button还绑定了点击处理函数*/}
            <NewsPublish dataSource={data} button={(id)=><Button danger onClick={()=>handleDelete(id)}>删除</Button>}></NewsPublish>
        </div>
    )
}
